// pages/control/history.js
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    skin:"",
    sDate: '2022-01-01',
    eDate:'2022-02-01',
    arr:[{
      date:'2022-02-01',
      dataArr:[[{
        name:'水泵1',
        title:'开',
        color:'#33CC66'
      },{
        name:'水泵2',
        title:'关',
        color:'#E8564D'
      },{
        name:'风机2',
        title:'开',
        color:'#33CC66'
      }],
      [{
        name:'水泵1',
        title:'开',
        color:'#33CC66'
      },{
        name:'水泵2',
        title:'关',
        color:'#E8564D'
      },{
        name:'风机2',
        title:'开',
        color:'#33CC66'
      }],
      [{
        name:'电池阀2',
        title:'开',
        color:'#33CC66'
      },{
        name:'电池阀3',
        title:'关',
        color:'#E8564D'
      },{
        name:'电池阀4',
        title:'关',
        color:'#E8564D'
      }]]
    },{
      date:'2022-02-01',
      dataArr:[[{
        name:'水泵1',
        title:'开',
        color:'#33CC66'
      },{
        name:'水泵2',
        title:'关',
        color:'#E8564D'
      },{
        name:'风机2',
        title:'开',
        color:'#33CC66'
      }],
      [{
        name:'水泵1',
        title:'开',
        color:'#33CC66'
      },{
        name:'水泵2',
        title:'关',
        color:'#E8564D'
      },{
        name:'风机2',
        title:'开',
        color:'#33CC66'
      }],
      [{
        name:'电池阀2',
        title:'开',
        color:'#33CC66'
      },{
        name:'电池阀3',
        title:'关',
        color:'#E8564D'
      },{
        name:'电池阀4',
        title:'关',
        color:'#E8564D'
      }]]
    },{
      date:'2022-02-01',
      dataArr:[[{
        name:'水泵1',
        title:'开',
        color:'#33CC66'
      },{
        name:'水泵2',
        title:'关',
        color:'#E8564D'
      },{
        name:'风机2',
        title:'开',
        color:'#33CC66'
      }],
      [{
        name:'水泵1',
        title:'开',
        color:'#33CC66'
      },{
        name:'水泵2',
        title:'关',
        color:'#E8564D'
      },{
        name:'风机2',
        title:'开',
        color:'#33CC66'
      }],
      [{
        name:'电池阀2',
        title:'开',
        color:'#33CC66'
      },{
        name:'电池阀3',
        title:'关',
        color:'#E8564D'
      },{
        name:'电池阀4',
        title:'关',
        color:'#E8564D'
      }]]
    }]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    const { skin } = app.globalData;
    this.setData({ skin });
  },
  bindSDateChange(e){
    let sDate = e.detail.value
    this.setData({
      sDate
    })
  },
  bindEDateChange(e){
    let eDate = e.detail.value
    this.setData({
      eDate
    })
  },
  handleBeginTimeChange(e) {
    this.setData({
      sDate: e.detail
    })
  },

  handleEndTimeChange(e) {
    this.setData({
      eDate: e.detail
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})